package com.example.week02.day1;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.week02.R;
import com.example.week02.day1.Activity.Liner;
import com.example.week02.day1.Activity.QQ_layout;
import com.example.week02.day1.Activity.Relative;
import com.example.week02.day1.Activity.Relative_2;
import com.example.week02.day1.Activity.SendBroadcast;
import com.example.week02.day1.Activity.SendBroadcast_2;
import com.example.week02.day1.Activity.caculator_layout;


public class day1 extends AppCompatActivity {

    Button day1_broad,day1_broad_2,day1_liner,day1_relative,day1_relative_2
            , caculator_layout,QQ_layout_but;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_day1);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });


        day1_broad = findViewById(R.id.day1_broad);
        day1_broad_2 = findViewById(R.id.day1_broad_2);
        day1_liner = findViewById(R.id.day1_liner);
        day1_relative = findViewById(R.id.day1_relative);
        day1_relative_2 = findViewById(R.id.day1_relative_2);
        caculator_layout = findViewById(R.id.caculator_layout);
        QQ_layout_but = findViewById(R.id.QQ_layout_but);

        day1_broad.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent  intent  = new Intent(day1.this, SendBroadcast.class);
                startActivity(intent);
            }
        });

        day1_broad_2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent  intent  = new Intent(day1.this, SendBroadcast_2.class);
                startActivity(intent);
            }
        });

        day1_liner.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent  intent  = new Intent(day1.this, Liner.class);
                startActivity(intent);
            }
        });

        day1_relative.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent  intent  = new Intent(day1.this, Relative.class);
                startActivity(intent);
            }
        });

        day1_relative_2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent  intent  = new Intent(day1.this, Relative_2.class);
                startActivity(intent);
            }
        });


        caculator_layout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent  intent  = new Intent(day1.this, caculator_layout.class);
                startActivity(intent);
            }
        });

        QQ_layout_but.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent  intent  = new Intent(day1.this, QQ_layout.class);
                startActivity(intent);
            }
        });



    }
}